<template>
  <div class="page-container">
    <PanelTab @change="handleChange" />
    <div class="page-content">
      <Panel1 :time="time" @showDialog="handleShowDialog" />
      <Panel2 :time="time" />
      <Panel3 :time="time" />
    </div>

    <!--  公告报名 -->
    <el-dialog title="报名记录" :visible.sync="showDialogSignUp" width="90%" top="30px">
      <DialogSignUp v-if="showDialogSignUp" :time="time" @close="showDialogSignUp = false" />
    </el-dialog>

    <!--  用户发布 -->
    <el-dialog title="用户发布" :visible.sync="showDialogUserPublish" width="90%" top="30px">
      <DialogUserPublish v-if="showDialogUserPublish" :time="time" @close="showDialogUserPublish = false" />
    </el-dialog>
  </div>
</template>

<script>
import PanelTab from '@/components/panel/PanelTab.vue'
import Panel1 from './components/Panel1.vue'
import Panel2 from './components/Panel2.vue'
import Panel3 from './components/Panel3.vue'
import DialogSignUp from './components/DialogSignUp.vue'
import DialogUserPublish from './components/DialogUserPublish.vue'

export default {
  name: 'NoticeBoard',
  components: { PanelTab, Panel1, Panel2, Panel3, DialogSignUp, DialogUserPublish },
  data() {
    return {
      time: {},
      showDialogSignUp: false,
      showDialogUserPublish: false,
    }
  },
  mounted() {},
  destroyed() {},
  methods: {
    // 时间变动
    handleChange(time) {
      this.time = time
    },
    // 查看更多
    handleShowDialog(type) {
      if (type === 'signUp') {
        this.showDialogSignUp = true
      } else if (type === 'userPub') {
        this.showDialogUserPublish = true
      }
    },
  },
}
</script>

<style scoped lang="scss"></style>
